let baseURL = 'https://r5ctn9z9.lc-cn-n1-shared.com'
export const $http = function(url,method='GET',data={}){
	return new Promise((resolve,reject)=>{
		uni.request({
			
			url:baseURL+url,//域名
			method,//发送请求
			header:{
				"X-LC-Id": "r5CTN9z96pCW8mI8fx9YxOmw-gzGzoHsz" ,
				"X-LC-Key": "8gSsl4Sz0ILMiQeMNMA8xQqg" ,
				 "Content-Type": "application/json"
			},
			data,
			success: (res) => {
				resolve(res.data)
			},
			fail: (err) => {
				reject(err)
			}
			
		})
	})
}


export const $get = function(url,data={}){
	return $http(url,'GET',data)
}

export const $post = function(url,data={}){
	return $http(url,'POST',data)
}
